meson: make sure gsk/gdk generated headers exist for libgtk_dep users
authorTim-Philipp Müller <tim@centricular.com>
Wed, 22 Mar 2017 00:45:39 +0000 (00:45 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Wed, 3 May 2017 14:10:54 +0000 (15:10 +0100)
Add back dependencies on libgdk_dep and libsk_dep which are declared
dependencies. We removed this before because these declarations had
link_with: lines that dragged in the static libgdk.a and libgsk.a libs
which are linked into libgtk-4.so anyway and thus shouldn't be used
when linking internal exes/tools against libgtk-4. Remove the static
libs from the declared dependencies and have libgtk link those in
explicitly, so that the declared deps now just provide all the built
dependencies and include dirs and such for declared libgtk_dep users
such as the internal exes/tools, which want all the generated gsk/gdk/gtk
headers to exist before attempting to compile anything against the
gtk+ headers.

gdk/meson.build
gsk/meson.build
gtk/meson.build
testsuite/gdk/meson.build

index e8656f14b9654cfc0107d88e02d79291a6661d05..fa5b66fb5c277a0c74dcbf0bd6ad4a72d4b6e436 100644 (file)
@@ -199,15 +199,13 @@ libgdk = static_library('gdk',
   c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'],
   include_directories: [confinc, xinc, wlinc],
   link_with: gdk_backends,
-  dependencies: gdk_deps,
-)
-
+  dependencies: gdk_deps)
 
+# We don't have link_with: to internal static libs here on purpose, just
+# list the dependencies and generated headers and such, for use in the
+# "public" libgtk_dep used by internal executables.
 libgdk_dep = declare_dependency(
   sources: ['gdk.h', gdkconfig, gdkenum_h],
   depends: gdk_sources,
   include_directories: [confinc, xinc, wlinc],
-  dependencies: gdk_deps,
-  link_with: libgdk,
-  link_args: ['-Bsymbolic'],
-)
+  dependencies: gdk_deps)
index 3bd0590a2e28c82378ea1368da47d232849e44bc..0b8743838bfd6c08ff8aa636dad304af929b792e 100644 (file)
@@ -157,12 +157,14 @@ libgsk = static_library('gsk',
   dependencies: gsk_deps,
   include_directories: [confinc],
   c_args: ['-DGSK_COMPILATION', '-DG_LOG_DOMAIN="Gsk"'],
-)
+  link_with: libgdk,
+  link_args: ['-Bsymbolic'])
 
+# We don't have link_with: to internal static libs here on purpose, just
+# list the dependencies and generated headers and such, for use in the
+# "public" libgtk_dep used by internal executables.
 libgsk_dep = declare_dependency(
   depends: gsk_sources,
-  link_with: libgsk,
-  link_args: ['-Bsymbolic'],
   include_directories: [confinc],
-  sources: [gskenum_h, gskresources]
-)
+  sources: [gskenum_h, gskresources],
+  dependencies: libgdk_dep)
index d667a6c036bcf9a8454089dca69a31f062cc9c34..2adbe2c6eaff43e018f659bd30182b834abe3f91 100644 (file)
@@ -830,22 +830,17 @@ libgtk = shared_library('gtk-4',
   sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h],
   c_args: gtk_cargs,
   include_directories: [confinc, gdkinc, gtkinc],
-  dependencies: [gtk_deps, libgdk_dep, libgsk_dep],
-  install: true
-)
+  dependencies: gtk_deps + [libgdk_dep, libgsk_dep],
+  link_with: [libgdk, libgsk],
+  link_args: ['-Bsymbolic'],
+  install: true)
 
 libgtk_dep = declare_dependency(
-  sources: [
-    'gtk.h',
-    gtkversion,
-    gtktypebuiltins_h,
-  ],
-  include_directories: [confinc],
-  dependencies: gtk_deps,
+  sources: [gtkversion, gtktypebuiltins_h],
+  include_directories: [confinc, gtkinc],
+  dependencies: gtk_deps + [libgdk_dep, libgsk_dep],
   link_with: libgtk,
-  link_args: ['-Bsymbolic'],
-  include_directories: [confinc, gtkinc]
-)
+  link_args: ['-Bsymbolic'])
 
 # Installed tools
 
index 6c85e75b93c917266291ec851b280b031f7cabf0..cfe2d07913e4bbfd357d4774f0cdea1a569342cb 100644 (file)
@@ -17,7 +17,7 @@ test('gdk/keysyms', test_keysyms)
 test_rectangle = executable('rectangle', 'rectangle.c', dependencies: libgtk_dep)
 test('gdk/rectangle', test_rectangle)
 
-test_rgba = executable('rgba', 'rgba.c', dependencies: libgdk_dep)
+test_rgba = executable('rgba', 'rgba.c', dependencies: libgtk_dep)
 test('gdk/rgba', test_rgba)
 
 test_seat = executable('seat', 'seat.c', dependencies: libgtk_dep)